package com.java1234.service;

import java.sql.Connection;
import java.sql.ResultSet;

import com.java1234.dao.IBorrowerDao;
import com.java1234.dao.ILibrarianDao;
import com.java1234.dao.IUserDao;
import com.java1234.dao.impl.BorrowerImpl;
import com.java1234.dao.impl.LibrarianImpl;
import com.java1234.dao.impl.UserImpl;
import com.java1234.model.Borrower;
import com.java1234.model.Librarian;
import com.java1234.model.SystemAdministrator;
import com.java1234.model.User;

public class UserService {

	private IUserDao userDao = new UserImpl();

	public void login(Connection con, User user) throws Exception {
		// 登录验证
		userDao.login(con, user);
	}

	public void list(Connection con, User user) throws Exception {// 展示用户列表
		userDao.list(con, user);
	}

	public void addBorrower(Connection con, Borrower borrower) throws Exception {// 往user表插入借阅者信息
		userDao.addBorrower(con, borrower);
	}

	public void updateBorrower(Connection con, Borrower borrower) throws Exception {
		userDao.updateBorrower(con, borrower);// 往user表借阅者修改信息
	}

	public void deleteBorrower(Connection con, String borrowerAccount) throws Exception {
		userDao.deleteBorrower(con, borrowerAccount);// 往user表借阅者删除信息
	}

	public void addLibrarian(Connection con, Librarian librarian) throws Exception {
		userDao.addLibrarian(con, librarian);// 往user表增加图书管理员信息
	}

	public void updateLibrarian(Connection con, Librarian librarian) throws Exception {
		userDao.updateLibrarian(con, librarian);// 往user表修改图书管理员信息
	}

	public void deleteLibrarian(Connection con, String librarianAccount) throws Exception {
		userDao.deleteLibrarian(con, librarianAccount);// 往user表删除图书管理员信息
	}

	public void addSystemAdministrator(Connection con, SystemAdministrator systemAdministrator) throws Exception {
		userDao.addSystemAdministrator(con, systemAdministrator);// 往user表增加图书管理员信息
	}

	public void updateSystemAdministrator(Connection con, SystemAdministrator systemAdministrator) throws Exception {
		userDao.updateSystemAdministrator(con, systemAdministrator);// 往user表修改图书管理员信息
	}

	public void deleteSystemAdministrator(Connection con, String systemAdministratorAccount) throws Exception {
		userDao.deleteSystemAdministrator(con, systemAdministratorAccount);// 往user表删除图书管理员信息
	}

}
